<fieldset>
    <legend>{:lang('条件搜索')}</legend>
    <form class="layui-form layui-form-pane form-search" action="{:sysuri()}" onsubmit="return false" method="get" autocomplete="off">

        
     
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">{:lang('用户编号')}</label>
            <label class="layui-input-inline">
                <input name="user_id" 
                value="{$get.user_id|default=''}" placeholder="{:lang('请输入用户编号')}" class="layui-input">
            </label>
        </div>
        
         <div class="layui-form-item layui-inline">
            <label class="layui-form-label">{:lang('订单号')}</label>
            <label class="layui-input-inline">
                <input name="order_no" 
                value="{$get.order_no|default=''}" placeholder="{:lang('请输入订单号')}" class="layui-input">
            </label>
        </div>

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">{:lang('支付状态')}</label>
            <label class="layui-input-inline">
                <select name="order_status"  class="layui-select">
                    <option value="">全部</option>
                    <option value="1">已支付</option>
                    <option value="0">未支付</option>
                </select>
            </label>
        </div>

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">{:lang('商品状态')}</label>
            <label class="layui-input-inline">
                <select name="status"  class="layui-select">
                    <option value="">全部</option>
                    <option value="1">已发货</option>
                    <option value="0">未发放</option>
                </select>
            </label>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">{:lang('下单时间')}</label>
            <div class="layui-input-inline">
                <input data-date-range name="add_time" value="{$get.add_time|default=''}" placeholder="{:lang('请选择下单时间')}" class="layui-input">
            </div>
        </div>
      
        <div class="layui-form-item layui-inline">
            <button type="submit" class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> {:lang('搜 索')}</button>
            <button type="button" data-form-export="{:url('index')}?type={$type|default=''}" class="layui-btn layui-btn-primary">
                <i class="layui-icon layui-icon-export"></i> {:lang('导 出')}
            </button>
        </div>
    </form>
</fieldset>

<script>
    require(['excel'], function (excel) {
        excel.bind(function (data) {
           
            // 设置表格内容
            data.forEach(function (item, index) {
                data[index] = [item.id, item.order_no, item.goods_name, item.integral, item.pay_price, item.user_id, item.nickname, item.username
                , item.mobile
                , item.address
                , item.status_text
                , item.order_status_text
                , item.courier_code
                , item.logistics_company
                , item.add_time
            ];
            });

            // 设置表头内容
            data.unshift(['ID', '{:lang("订单编号")}', '{:lang("商品名称")}', '{:lang("消耗积分")}', '{:lang("支付金额")}', '{:lang("兑换会员ID")}', '{:lang("会员昵称")}'
            , '{:lang("姓名")}'
            , '{:lang("手机号")}'
            , '{:lang("收货地址")}'
            , '{:lang("商品状态")}'
            , '{:lang("支付状态")}'
            , '{:lang("物流单号")}'
            , '{:lang("物流商")}'
            , '{:lang("订单时间")}'
            ]);

            // 应用表格样式
            return this.withStyle(data, {A: 60, B: 80, C: 99, E: 120, G: 120});

        }, '{:lang("消费者兑换")}' + layui.util.toDateString(Date.now(), '_yyyyMMdd_HHmmss'));
    });
</script>